package com.voilet.interview.rx.kt

import android.os.Bundle
import android.os.PersistableBundle
import androidx.appcompat.app.AppCompatActivity
import io.reactivex.Observable

/**
 * Created by kan212 on 2019/4/14.
 */
class KtRxActivity : AppCompatActivity() {


    override fun onCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) {
        super.onCreate(savedInstanceState, persistentState)
    }

    fun observer() {

        val names: Array<String> = arrayOf("Christina", "Nicole", "Alison")
        Observable.fromArray(names)

//        Observable.create(new OnSubscribe<String>() {
//            @Override
//            public void call(Subscriber <? super String> subscriber)
//            subscriber.onNext("I created an Observable!"
//                    subscriber.onCompleted();
//        });

        Observable.create<String> { s ->
            s.onNext("测试")
            s.onComplete()
        }

    }

}